package com.jabo.wechatmomentsdemo.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ImageView;
import android.widget.Toast;

import com.jabo.wechatmomentsdemo.utils.GlideUtil;

import java.util.List;

/**
 * @anthor JZheng3
 * @Time: 2020/9/6
 */
public class PengYouQuanFlagLayout extends PengYouQuanFlagView {
    private String TAG = PengYouQuanFlagLayout.class.getSimpleName();
    private Context mContext;

    public PengYouQuanFlagLayout(Context context) {
        this(context, null);
    }

    public PengYouQuanFlagLayout(Context context, AttributeSet attrs) {
        super(context, attrs);
        this.mContext = context;
    }

    @Override
    protected void displayImage(int position, ImageView imageView, String url) {
        if (mContext != null) {
            GlideUtil.loadUrlHandleErrorImage(mContext, url, imageView);
        }
    }

    @Override
    protected void onClickImage(int position, String url, ImageView imageView, List<String> imgList) {
        //处理图片地方
        Toast.makeText(mContext, "点击了" + position +"， 由于时间原因暂未实现更多功能", Toast.LENGTH_SHORT).show();
    }
}